<?php

namespace apiend\modules\search\controllers;

use Yii;
use apiend\components\Controller;

/**
 * 默认检索相关接口
 * DefaultController for the `search` module
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class DefaultController extends Controller {

    public $modelClass = 'apiend\modules\search\models\UnifiedSearch';

    /**
     * 根据分类ID检索课程列表
     * @inheritdoc
     */
    public function actionIndex() {
        /* @var $modelClass \apiend\modules\search\models\UnifiedSearch */
        $modelClass = new $this->modelClass;
        return $modelClass->search(Yii::$app->request->getQueryParams());
    }

}
